package com.example.jersey.config;

import org.glassfish.jersey.server.ResourceConfig;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

/**
 * @author Mr.yuan
 * @version v1.0
 * @date 2020/1/2 10:34
 * 第一种方式
 **/
//@Component
//public class JerseyConfig extends ResourceConfig {
// //    http://localhost:8082/resource/sayhi?msg=wolfcode
//    public JerseyConfig() {
//        register(SpringbootResource.class);
//    }
//}

    /**
     * 第二种方式
     * @author Mr.yuan
     * @date 2020/1/2 11:02
     **/
@Configuration
public class  JerseyConfig {

    @Bean
    public ResourceConfig resourceConfig() {
        ResourceConfig config = new ResourceConfig();
        config.register(SpringbootResource.class);
        return config;
    }
}
